#include <glib.h>

typedef struct _GRealArray
{
  guint8 *data;
  guint   len;
  guint   alloc;
  guint   elt_size;
  guint   zero_terminated : 1;
  guint   clear : 1;
  gint    ref_count;
  GDestroyNotify clear_func;
}GRealArray;

gint main(gint argc, gchar **argv)
{
    GRealArray *array;
    guint zero_terminated = 0;
    guint clear = 0;
    guint elt_size = 100;
    
    // Allocate one block, using the g_slice_new() macro.
    array = g_slice_new (GRealArray);
    
    // We can now use array just like a normal pointer to a structure.
    array->data            = NULL;
    array->len             = 0;
    array->alloc           = 0;
    array->zero_terminated = (zero_terminated ? 1 : 0);
    array->clear           = (clear ? 1 : 0);
    array->elt_size        = elt_size;
    
    // We can free the block, so it can be reused.
    g_slice_free (GRealArray, array);

    return 0;
}
